<?php

class Mod_report extends Model {

    function Mod_report() {
        parent::Model();
    }

    function index() {
        
    }
    function select_report(){
        $dat_from=$this->input->post('txt_datestart');
         $dat_to=$this->input->post('txt_date_to');
         $this->db->select('sal_date,sal_quantity,use_username,car_name,sal_price,sal_payment');
         $this->db->from('tbl_sale');
         $this->db->join('tbl_card','tbl_card.car_id=tbl_sale.car_id');
         $this->db->join('tbl_car_type','tbl_car_type.car_type_id=tbl_card.car_type_id');
         $this->db->where('sal_date >=',$dat_from);
         $this->db->where('sal_date <=',$dat_to);
         return $this->db->get();
    }
    function select_product(){
        $dat_from=$this->input->post('txt_datestart');
         $dat_to=$this->input->post('txt_date_to');
         $this->db->select('sal_date,sal_quantity,use_username,pro_name,sal_price,sal_payment');
         $this->db->from('tbl_sale');
         $this->db->join('tbl_product','tbl_product.pro_id=tbl_sale.pro_id');
         $this->db->join('tbl_pro_type','tbl_pro_type.pro_type_id=tbl_product.pro_type_id');
         $this->db->where('sal_date >=',$dat_from);
         $this->db->where('sal_date <=',$dat_to);
         return $this->db->get();
    }
    
}   